package com.wuyb.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wuyb.mapper.MeetingPasswordMapper;
import com.wuyb.pojo.MeetingPassword;
import com.wuyb.service.MeetingPasswordService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: wyb
 * @Date: 2024/01/02/16:13
 * @Description:
 */
@Service
@Slf4j
public class MeetingPasswordServiceImpl extends ServiceImpl<MeetingPasswordMapper, MeetingPassword> implements MeetingPasswordService {

    @Resource
    private MeetingPasswordMapper meetingPasswordMapper;

    @Override
    public int insert(String id, String password, Boolean passEnabled) {
        return meetingPasswordMapper.insert(new MeetingPassword().setMeetingId(id).setPassword(password).setEnabled(passEnabled));
    }

    @Override
    public MeetingPassword getMeetingPasswordOne(String meetingId) {
        return meetingPasswordMapper.selectOne(new QueryWrapper<MeetingPassword>().eq("meeting_id_xq",meetingId));
    }
}
